<template>
	<view>
		<u-tabbar
			:fixed="true"
			:placeholder="true"
			:safeAreaInsetBottom="true"
			activeColor="#2D73F0"
			inactiveColor="#333"
		>
			<u-tabbar-item text="首页" @click="navigateToByTabbar">
				<image class="bar_img" slot='inactive-icon' src="/static/img/tabbar/home.png"></image>
				<image class="bar_img" slot='active-icon' src="/static/img/tabbar/home_art.png"></image>
			</u-tabbar-item>
			<u-tabbar-item text="工作台" @click="navigateToByTabbar">
				<image class="bar_img" slot='inactive-icon' src="/static/img/tabbar/center.png"></image>
				<image class="bar_img" slot='active-icon' src="/static/img/tabbar/center_art.png"></image>
			</u-tabbar-item>
			<u-tabbar-item text="我的" @click="navigateToByTabbar">
				<image class="bar_img" slot='inactive-icon' src="/static/img/tabbar/user.png"></image>
				<image class="bar_img" slot='active-icon' src="/static/img/tabbar/user_art.png"></image>
			</u-tabbar-item>
		</u-tabbar>
	</view>
</template>

<script>
	export default {
		name:"buttom-tabbar",
		data() {
			return {
				
			};
		},
		methods: {
			navigateToByTabbar(e)
			{ 
				let url = "";
				if(e==0)
				{
					url =  "/pages/index/index"
				}else if(e==1)
				{
					url =  '/pages/work/index'
				}else if(e==2)
				{
					url =  '/pages/center/index'
				}
				//console.log(url)
				//console.log('click1', e);
				//uni.navigateTo({ url: url })
				uni.reLaunch({ url: url }) 
			}
		}
	}
</script>

<style>
	.bar_img{
		width: 54rpx;
		height: 54rpx;
	}
</style>